package com.shiguiwu.springmybatis.spring.imports.selector;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @description: ImportSelector的现实类，也能被import导进去
 * @author: stone
 * @date: Created by 2021/9/29 16:54
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.imports.selector
 */
public class MyImportSelector implements ImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        return new String[]{
                Selector.class.getName(),
                SelectConfig.class.getName()
        };
    }


    public static class Selector {

    }

    @Configuration
    public static class SelectConfig {

        @Bean
        public String username1() {
            return "石贵武";
        }

        @Bean
        public Integer age1() {
            return 18;
        }

    }
}
